-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add multi-arch (arm64) support for docker/podman drivers #9969
add multi-arch (arm64) support for docker/podman drivers #9969
Conversation
Any reason for the name change? |
The idea is to support both multi-arch kicbase image and the amd64 only for some time. |
AFAIK, buildx is experimental, but multi-arch pulls should not be experimental any longer. Docker updated all of it's images to multi-arch back in 2017: https://www.docker.com/blog/docker-official-images-now-multi-platform/ Kubernetes dropped suffixes for architectures about 2 years ago. To make the code simpler, I would suggest we do the same until a specific limitation can be identified. |
What we (and they) did for the other images, is that we used the arch suffix for the specific images. k8s.gcr.io/kube-proxy-amd64:v1.20.0 {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1786,
"digest": "sha256:f0c3f51c1216bcab9bfd5146eb2810f604a1c4ff2718bc3a1028cc089f8aeac7",
"platform": {
"architecture": "amd64",
"os": "linux"
}
}, k8s.gcr.io/kube-proxy-arm64:v1.20.0 {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1786,
"digest": "sha256:8537b2a8f4aa57e890b838ceaa2d3317d3ff31a936cc3cc82c96e0689f34853c",
"platform": {
"architecture": "arm64",
"os": "linux"
}
}, So you would have a "foo-amd64" and an "foo-arm64", and then a manifest for those called "foo". The user is only exposed to the manifest name:tag, and then it pulls the images behind the curtain
Note that this "image" is just the (JSON) manifest, it's not actually a real image with layers and stuff. |
The main problem is that the daemon doesn't understand architectures. So you can only work with one architecture at the time, when cross-building. I did that workaround in my multi-image build, when kic inherited from kind... |
ok, makes sense. will fix. |
pkg/drivers/kic/types.go
Outdated
@@ -26,15 +26,29 @@ const ( | |||
// Version is the current version of kic | |||
Version = "v0.0.15-snapshot4" | |||
// SHA of the kic base image | |||
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16" | |||
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16" | |||
baseMultiArchImageSHA = "todo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get rid of this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
pkg/drivers/kic/types.go
Outdated
@@ -26,15 +26,29 @@ const ( | |||
// Version is the current version of kic | |||
Version = "v0.0.15-snapshot4" | |||
// SHA of the kic base image | |||
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16" | |||
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets verify if SHA is same for arm64 and amd if not, we should have two shas in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ubuntu@ip-172-31-39-30:~/src/minikube$ uname -a
Linux ip-172-31-39-30 5.4.0-1032-aws #33-Ubuntu SMP Wed Dec 9 17:17:06 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ip-172-31-39-30:~/src/minikube$ docker inspect --format='{{index .RepoDigests 0}}' ilyazuyev/kicbase:pr-test
ilyazuyev/kicbase@sha256:949338df4b157b907fbc9b27466c160c609f2f0f17c5dce73d2ceda084fedb69
izuyev@izuyev-macbookpro --- ~ » uname -a
Darwin izuyev-macbookpro.roam.corp.google.com 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
izuyev@izuyev-macbookpro --- ~ » docker inspect --format='{{index .RepoDigests 0}}' ilyazuyev/kicbase:pr-test
ilyazuyev/kicbase@sha256:949338df4b157b907fbc9b27466c160c609f2f0f17c5dce73d2ceda084fedb69
izuyev@izuyev-macbookpro --- ~ »
It's the same sha1
/ok-to-test |
/retest-this-please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the good work on this PR, feel free to merge after docker_linux tests are normal
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ilya-zuyev, medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR changes kicbase image to multi-arch format, supporting arm64/linux architecture and enables docker driver for arm64 systems
In the example below I'm using
ilyazuyev/kicbase:pr-test
image name for demo purposesThen on an arm64 machine: